package com.landian.commons.base.page;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author caojl
 * @date: 2019-10-06
 * @time: 23:02
 */
@Data
@AllArgsConstructor
public class PageRequest implements PageAble{

    private static int DEFAULT_PAGE = 1;
    private static int DEFAULT_PAGE_SIZE = 10;

    public static PageRequest newInstance(int page, int pageSize){
        return new PageRequest(page,pageSize);
    }

    public static PageRequest newInstance(){
        return new PageRequest(DEFAULT_PAGE,DEFAULT_PAGE_SIZE);
    }

    public static PageRequest max(){
        return new PageRequest(DEFAULT_PAGE,Integer.MAX_VALUE);
    }

    /**
     * 请求页数
     */
    private Integer page;

    /**
     * 分页大小
     */
    private Integer size;
}
